{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>

                    <!--修改状态模板-->
                    <!--<script type="text/html" id="staBar">-->
                    <!--<input type="checkbox" value="{{d.school_id}}"  lay-skin="switch"  lay-text="上架中|已下架" lay-filter="OnOff" {{ d.school_status == 1 ? 'checked' : '' }} >-->
                    <!--</script>-->

                    <!--状态显示模板-->
                    <script type="text/html" id="statBar">
                        {{# if(d.rs_status == 1){ }}
                        上架中
                        {{# } }}
                        {{# if(d.rs_status == 2){ }}
                        已下架
                        {{# } }}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("book/customs")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true,
            where: {id:{:session('book_id1')}}
            , id: 'testReload'
            , cols: [[
               {type:'numbers', width: 80, title: '序号'}
                , {field: 'rs_id', width: 80, title: '试题ID', align: 'center'}
                , {field: 'rs_status', width: 100, title: '状态', align: 'center', toolbar: '#statBar'}
                , {field: 'rs_book_id', width: 100, title: '关联书籍ID', align: 'center'}
                , {field: 'rs_game_id', width: 100, title: '关卡序号', align: 'center'}
                , {field: 'rs_name', width: 200, title: '题目标题', align: 'center'}
                , {field: 'rs_a', width: 200, title: '选择a', align: 'center'}
                , {field: 'rs_b', width: 200, title: '选择b', align: 'center'}
                , {field: 'rs_c', width: 200, title: '选择c', align: 'center'}
                , {field: 'rs_d', width: 200, title: '选择d', align: 'center'}
                , {field: 'rs_answer', width: 100, title: '正确答案', align: 'center'}
                , {field: 'rs_difficult', width: 100, title: '难度系数', align: 'center'}
                , {field: 'rs_update_time', width: 150, title: '更新时间', align: 'center'}
                , {field: 'rs_type_name', width: 80, title: '类型', align: 'center'}
                , {field: 'username', width: 100, title: '更新人', align: 'center'}
                , {field: 'rs_remark', width: 200, title: '备注内容', align: 'center'}
            ]]
        });
    });
</script>
</body>
</html>